home *** CD-ROM | disk | FTP | other *** search
/ Varios Español / Varios Español.iso / DBASE5 / TEMPLATE.ZIP / AD_SORT.COD < prev    next >
Text File  |  1994-10-12  |  1KB  |  49 lines

  1. //
  2. // Module Name: AD_SORT.COD - Menu_Act = 15
  3. // Selectors  : Sort_File, SortField*, Sort_Ord*, Sort_Case*
  4. //            : Scope, For_Expr, While_Exp
  5. // Description: to issue the dBASE SORT command
  6. // Syntax     : SORT TO <expFN> ON <field name> [/A] [/C] [/D]
  7. //                   [,<field name> [/A] [/C] [/D]...]
  8. //                   [<scope>] [FOR <expL>] [WHILE <expL>]
  9. //
  10. *--  Desc: Ordena registros en {Sort_File}
  11. lc_say='Ordenando registros en {Sort_File}'
  12. DO info_box WITH lc_say
  13. {if !Set_Safety then //safety on}
  14. lc_safety = SET("SAFETY")
  15. SET SAFETY OFF
  16. {endif}
  17. SET TALK ON
  18. {if Sort_File}
  19. SORT TO {Sort_File} \
  20. { if SortField1}
  21. ON {SortField1}{SUBSTR("/A/D",(Sort_Ord1*2)+1,2)}{if Sort_Case1 == 0}C{endif}\
  22. { endif}
  23. { if SortField2}
  24.  , {SortField2}{SUBSTR("/A/D",(Sort_Ord2*2)+1,2)}{if Sort_Case2 == 0}C{endif}\
  25. { endif}
  26. { if SortField3}
  27.  , {SortField3}{SUBSTR("/A/D",(Sort_Ord3*2)+1,2)}{if Sort_Case3 == 0}C{endif}\
  28. { endif}
  29. { if SortField4}
  30.  , {SortField4}{SUBSTR("/A/D",(Sort_Ord4*2)+1,2)}{if Sort_Case4 == 0}C{endif}\
  31. { endif}
  32. { if SortField5}
  33.  , {SortField5}{SUBSTR("/A/D",(Sort_Ord5*2)+1,2)}{if Sort_Case5 == 0}C{endif}\
  34. { endif}
  35. {if !Scope && !For_Expr && !While_Exp then} &gc_scope. {endif}\
  36. {if Scope} {upper(Scope)} {endif}\
  37. {if For_Expr} FOR {For_Expr}{endif}\
  38. {if While_Exp} WHILE {While_Exp}{endif}\
  39.  
  40. {endif}
  41. //
  42. SET TALK OFF
  43. {if !Set_Safety then //safety on}
  44. SET SAFETY &lc_safety.
  45. {endif}
  46. //
  47. // EOP AD_SORT.COD
  48.  
  49.